/**
 * Copyright (c) 2013-2022 Nikita Koksharov
 * <p>
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 * <p>
 * http://www.apache.org/licenses/LICENSE-2.0
 * <p>
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */
package org.redisson.client.codec;

import org.redisson.client.protocol.Decoder;
import org.redisson.client.protocol.Encoder;

/**
 * 公共接口编解码器
 * 高效地进行序列化和反序列化
 */
public interface Codec {

    /**
     * 返回用于 HMAP Redis 结构中的哈希映射值的对象解码器
     */
    Decoder<Object> getMapValueDecoder();

    /**
     * 返回用于 HMAP Redis 结构中的哈希映射值的对象编码器
     */
    Encoder getMapValueEncoder();

    /**
     * 返回用于 HMAP Redis 结构中哈希映射键的对象解码器
     */
    Decoder<Object> getMapKeyDecoder();

    /**
     * 返回用于 HMAP Redis 结构中哈希映射键的对象编码器
     */
    Encoder getMapKeyEncoder();

    /**
     * 返回用于存储 Redis 结构的任何对象的对象解码器（HMAP 除外）
     */
    Decoder<Object> getValueDecoder();

    /**
     * 返回用于存储 Redis 结构的任何对象的对象编码器（HMAP 除外）
     */
    Encoder getValueEncoder();

    /**
     * 返回用于加载解码过程中使用的类的类加载器对象
     */
    ClassLoader getClassLoader();

}
